1. Field of the Invention
The present invention relates to the field of graphic manipulations and, more particularly, to adjusting left-to-right graphics to a right-to-left orientation using transformations with adjustments for line width and pixel orientation.
2. Description of the Related Art
Modern software programs are often written in an internationalized form to permit a user to choose a language for interactions. Changes to a base language can change a language of menu items, tips, help content, and the like. For example, a user of an internationalized word processing program can often configure the program for English, Spanish, French, German, Hindu, Chinese, Arabic, Hebrew, and other popular languages. Base code of an internationalized program lacks language specific labels. Instead, unique keys are used in the base code, which correspond to a language specific items that are associated with these unique keys. Language specific substitutions can occur at compile time for an internationalized software application or at runtime. Even when software is not internationalized to permit a user to adjust a language, a software development team is often forced to create different variants of a base program adjusted for a national language of a target market. Thus, one variant of a software program is customized for English, another for Spanish, another for Arabic, and so forth.
Changing a language of a software application can involve more than just replacing letters and words from one language to another. Language adjustments can also involve changing an orientation of graphical elements. For example, in a left-to-right language, graphics and text typically start at a top left corner of a window and flow towards the right. For instance, a tree control can expand to the right when a user clicks on an expansion indicator (+/−) and a vertical scroll bar can appear on a right side of a window. In a right-to-left language, however, the same tree control can expand to the left when a user clicks on an expansion indicator and a vertical scroll bar can appear on a left side of a window.
At present, there are two ways to deal with orientation adjustments. A first is to create two versions of all base code, one for a left-to-right orientation and another for a right-to-left orientation. This approach is time consuming, costly, and maintenance intensive. A second approach is to write all base code for a specific orientation and to apply an adjustment algorithm to change an orientation of graphical objects before they are rendered. This second approach is often referred to as mirroring.
Some toolkits exist that provide software tools for mirroring graphics. Unfortunately, pre-existing toolkits produce error prone results. Sometimes mirrored graphics resulting from mirroring tools are properly rendered and other times mirrored graphics appear to be “off by a few pixels.” At present, developers have been forced to either use pre-existing toolkits having pixel adjustment issues when mirroring is enabled or to implement orientation adjustments from scratch using application specific code.